import requests


def main():
    url = "https://qianfan.baidubce.com/v2/app/conversation/file/upload"

    payload = {
        'app_id': '5eb075e9-8551-4357-8534-5dad224eaed7',
        'conversation_id': '7275da3d-4c50-4938-aa5d-010fd4ba2931'
    }
    files = [
        ('file', ('R-C.jpg', open('C:\\Users\\zh415st026\\Desktop\\R-C.jpg', 'rb'), 'image/jpeg'))
    ]
    headers = {
        'X-Appbuilder-Authorization': 'Bearer bce-v3/ALTAK-qdOByRlbA0Hhrz4scRjl4/b259a3971f73a10f20d5ab583fb1a1388eafacbf'
    }

    response = requests.request("POST", url, headers=headers, data=payload, files=files)

    print(response.text)


if __name__ == '__main__':
    main()
